<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>房屋抵押</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=f5a12a1d">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">

    <style>
        table input {
            border: none;
            width: 100%;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }
        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }
        input[type=text], input[type=tel], input[type=number], select {
            box-sizing: border-box;
            border-width: 0px;
            border-style: none;
            padding-right: 0px !important;
            padding-top: 0px !important;
            padding-bottom: 0px !important;
            margin-left: 0px !important;
            margin-right: 0px !important;
            margin-top: 0px !important;
            margin-bottom: 0px !important;
            padding-left: 6px;
        }

        input[type=text], input[type=tel], input[type=number], select {
            height: 24px;
            width: 100%;
            border: none;
            outline: none;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }
        .user {
            height: 30px;
            line-height: 30px;
            max-height: 30px;
            float: left;
            text-align: left;
            min-width: 32px;
            padding-left: 1px;
            overflow: hidden;
            cursor: pointer;
        }

        .user:hover {
            background-color: #cfd4d1;
        }

        .userbox .select.user {
            color: #fff;
            background-color: #045B9E;
        }

        .span-btn {
            position: absolute;
            left: 10px;
            margin-top: 4px;
            cursor: pointer;
        }

        .auditorName {
            text-align: center;
        }

        .IcoNormal {
            float: left;
            border-bottom: 0px;
            border-left: 0px;
            background-color: transparent;
            width: 16px;
            height: 16px;
            /*vertical-align: middle;*/
            border-top: 0px;
            border-right: 0px;
            background-image: url(/dist/img/upload_normal.gif);
            background-repeat: no-repeat;
            float: left;
        }

        .progressobj {
            height: 20px;
        }

        .progressobj .delfile {
            float: left;
            margin-left: 10px;
        }

        .select {
            color: #fff;
            background-color: #045B9E;
        }

        td .sp-value {
            display: inline-block;
            padding-left: 6px;
            word-wrap: break-word;
        }
        td.td-title, td select, td .filename{
            font-weight: normal !important;
        }

        .table-detail-payee:nth-child(even) td.td-title {
            background-color: white;
        }

        .printDiv {
            display: none;
        }
        .span-a-btn {
            position: absolute;
            right: 10px;
            margin-right: 19px;
        }
        .td-value1 {
            text-align: center !important;
            vertical-align: middle;
            word-wrap: break-word;
            color: #2a8cec !important;
        }
        table .td-module {
            background: yellow !important;
            line-height: 24px;
            font-weight: bold;
        }
        .td-value1 input {
            text-align: center;
        }
        .a-btn{
            color: black;
        }

    </style>
</head>

<body>
<section class="content" id="app" v-cloak>
    <div class="box-body no-padding" style="overflow: auto;" id="scrollDiv">
        <div id="progress" class="wyui-progress"></div>
        <table class="table table-bordered text-center">
            <tr>
                <td colspan="5" class="td-module">提货地址
                    <span class="span-a-btn" v-if="pageType=='edit'" style="color: black;">
                <a href="javascript:void(0);" class="a-btn"
                   @click="addRow('list','stock')">添加一行</a>
                <a href="javascript:void(0);" class="a-btn"
                   @click="delRow('stock')">删除一行</a>
                </span>
                </td>
            </tr>
            <tr>
                <th style="width:40px;">序号</th>
                <th>品牌</th>
                <th>提货地址</th>
                <th>联系人</th>
                <th>电话</th>
            </tr>
            <tr v-for="(item,i) in list" class="td-row2 td-value">
                <td style="width:40px;">{{i+1}}</td>
                <td class="td-value1">
                    <select id="testBran" v-model="item.brandId">
                        <option v-for="items in brandList" v-bind:value="items.id">{{items.brandName}}</option>
                    </select>
                </td>
                <td><input type="text" v-model="item.brandAddress" v-if="pageType=='edit'" style="text-align: center !important;">
                    <span v-else>{{item.brandAddress}}</span></td>
                <td><input type="text" v-model="item.contact" v-if="pageType=='edit'" style="text-align: center !important;">
                    <span v-else>{{item.contact}}</span></td>

                <td><input type="text" v-model="item.contactTel" v-if="pageType=='edit'" style="text-align: center !important;">
                    <span v-else>{{item.contactTel}}</span></td>

            </tr>
        </table>
        <div style="padding: 10px 0;align-content:center;" v-if="pageType=='edit'">
            <input type="button" class="btn btn-primary btn-sm oaBtn" @click="save()" value="保存"
                   style="margin-left: 400px ;margin-top: 5px;" v-if="pageType=='edit'">
        </div>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=0b5caf39"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=0c4d95a9"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script src="manage/Template.js?t=42e28def"></script>
<script type="text/javascript">
    var api = frameElement.api, W = api.opener;
    var app = new Vue({
        el: '#app',
        data: {
            pageType: $.wyui.page.urlParams.pageType,
            brandList:[],
            list: [
                {
                    brandId:"",
                    contactTel:"",
                    contact:"",
                    brandAddress:""
                },
                {
                    brandId:"",
                    contactTel:"",
                    contact:"",
                    brandAddress:""
                },
                {
                    brandId:"",
                    contactTel:"",
                    contact:"",
                    brandAddress:""
                },
                {
                    brandId:"",
                    contactTel:"",
                    contact:"",
                    brandAddress:""
                }
            ]
        },
        methods: {
            save: function (id) {
                var that = this;
                $.wyui.postMethod('/brandStrock/save.json', trimRN(that.list), function (r) {
                    if (r.records == true) {
                        alert("保存成功");
                        api.close();
                    } else {
                        alert("保存失败，请重新输入");
                    }
                });

            },
            addRow: function (prop, template) {
                this.list.push(new Template[template]());
            },
            delRow: function (prop) {
                this.list.splice(this.list.length - 1, 1);
            },
        },
        mounted: function () {
            var that = this;
            $.wyui.postMethod("/deviceBrand/getBrandList.json", {}, function (r) {
                that.brandList = r.records;
            });
            $.wyui.postMethod("/brandStrock/selectByBrandId.json", {}, function (r) {
                that.list = r;
            });
        }
    });

</script>

</body>
</html>